#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
using namespace std;
const int N = 20;
int T[N], D[N], L[N];
bool st[N];
int n;
bool dfs(int pos, int end)
{
    if (pos > n)
    {
        return true;
    }
    for (int i = 1; i <= n; i++)
    {
        if (st[i])
        {
            continue;
        }
        if (T[i] + D[i] < end)
        {
            continue;
        }
        st[i] = true;
        int newend = max(end, T[i]) + L[i];
        if (dfs(pos + 1, newend))
        {
            return true;
        }
        st[i] = false;
    }
    return false;
}
int main()
{
    int s;
    cin >> s;
    while (s--)
    {
        memset(st, 0, sizeof(st));
        cin >> n;
        for (int i = 1; i <= n; i++)
        {
            cin >> T[i] >> D[i] >> L[i];
        }
        if (dfs(1, 0))
        {
            cout << "YES" << endl;
        }
        else
        {
            cout << "NO" << endl;
        }
    }
}